﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using IQKS.AWP.BusinessObject;

namespace IQKS.AWP.DataAccessLayer
{
    public class CandidateBriefDAL
    {

        public DataSet GetCandidateBriefDetail(params object[] param)
        {
            DataSet objDs;

            try
            {
                objDs = DataUtils.ExecuteDataset("Usp_GetCandidateBriefDetail", param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }


        public DataSet GetCandidateBriefMapping(params object[] param)
        {
            DataSet objDs;

            try
            {
                objDs = DataUtils.ExecuteDataset("Usp_GetCandidateBriefMapping", param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetCandidateBriefMappingbyCandidateDetails(params object[] param)
        {
            DataSet objDs;

            try
            {
                objDs = DataUtils.ExecuteDataset("Usp_GetCandidateBriefMappingbyCandidateDetails", param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }


        public object SetCandidateBriefDetail(CandidateBriefBO param)
        {
            try
            {
                SqlParameter[] parameters = new SqlParameter[]
               {
                new SqlParameter("@SetMethod",param.SetMethod),
                new SqlParameter("@BriefID", param.BriefID),
                new SqlParameter("@CandidateID",param.CandidateID),
                new SqlParameter("@UserID",param.UserId)
               };
                return DataUtils.ExecuteScalar("Usp_SetCandidateBriefDetail", parameters);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }


    }
}
